import axiosInstance from "../axiosInstance";

const adminInfo = {
    /**
     * 管理员登陆检测
     * @param {zh,admin_pwd} param0 
     * @returns {Prommise<Object>}
     */
    checkLogin({ zh, admin_pwd }) {
        return axiosInstance.post(`adminInfo/checkLogin`, {
            zh, admin_pwd
        })
    },
    getListByPage({ pageIndex, admin_name, admin_sex, admin_tel, admin_email }) {
        return axiosInstance.get(`adminInfo/getListByPage`, {
            params: {
                pageIndex, admin_name, admin_sex, admin_tel, admin_email
            }
        })
    },
    deleteById(id) {
        return axiosInstance(`/adminInfo/findById`, {
            params: {
                id
            }
        })
    },
    /**
     * 
     * @param {Number} id 
     * @returns 
     */
    findById(id) {
        return axiosInstance.get(`/adminInfo/findById`, {
            params: {
                id
            }
        })
    },
    /**
     * 更新
     * @param {} param0 
     * @returns 
     */
    update({ id, admin_name, admin_pwd, admin_sex, admin_tel, admin_email, admin_photo, admin_type }) {
        return axiosInstance.post(`/adminInfo/update`, {
            id, admin_name, admin_pwd, admin_sex, admin_tel, admin_email, admin_photo, admin_type
        })
    },
    /**
     * 增
     * @param {*} param0 
     * @returns 
     */
    add({ admin_name, admin_pwd, admin_sex, admin_tel, admin_email, admin_photo, admin_type }) {
        return axiosInstance.post(`/adminInfo/add`, {
            admin_name, admin_pwd, admin_sex, admin_tel, admin_email, admin_photo, admin_type
        })
    },

  



}
export default adminInfo;